<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>isAbsoluteURL</title>
</head>
<body>
    <script>
        const href = window.location.href;
        const isAbsoluteURL = url => /^[a-z][a-z0-9+.-]*:/.test(url);
        const answer = `当前路径是否是绝对路径:${ isAbsoluteURL(href) ? '是' : '否'}`;
        document.writeln(answer);
        console.log(answer);
    </script>
</body>
</html>